home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / frm2prg2.arc / FRM2PRG2.DOC < prev    next >
Text File  |  1989-04-02  |  16KB  |  395 lines

  1.  
  2.  
  3.                  FRM2PRG Version 2 Documentation
  4.  
  5.  
  6.  
  7. I.   Overview  . . . . . . . . . . . . . . . . . . . . . . .    1
  8.    A. What It Is . . . . . . . . . . . . . . . . . . . . . .    1
  9.    B. What Good Is It? . . . . . . . . . . . . . . . . . . .    1
  10.    C. Usage  . . . . . . . . . . . . . . . . . . . . . . . .    1
  11.       1. Command-line Switches . . . . . . . . . . . . . . .    2
  12.       2. Examples  . . . . . . . . . . . . . . . . . . . . .    2
  13. II.  Limitations . . . . . . . . . . . . . . . . . . . . . .    3
  14. III. History . . . . . . . . . . . . . . . . . . . . . . . .    3
  15. IV.  Registration And Sundry Commercials . . . . . . . . . .    5
  16. V.   Order Form  . . . . . . . . . . . . . . . . . . . . . .    6
  17.  
  18.  
  19.                  FRM2PRG Version 2 Documentation
  20.  
  21.  
  22.  
  23. I.   Overview
  24.  
  25. A. What It Is
  26.  
  27. This program attempts to convert a dBASE FRM file to a PRG (procedure) file. If
  28. you don't know what one or both of those are, stop now.  This program is not
  29. for you.
  30.  
  31. If you're masochistic enough to use dBASE IV at this point, FRM2PRG is also not
  32. for you.  Modify the templates for dBASE IV instead, if you have a coupla spare
  33. months [grin].
  34.  
  35.  
  36. B. What Good Is It?
  37.  
  38. I often prototype reports using MODIFY REPORT, then when the thing gets OK'd or
  39. whatnot I write a custom PRG to do the report, adding some enhancements.
  40. FRM2PRG enables me to generate a PRG file directly from the FRM file, and then
  41. make any  modifications.
  42.  
  43. FRM2PRG should make life easier when converting someone else's app.
  44.  
  45. ...and, of course, those of you who actually *use* FRM files with compiled apps
  46. can now compile them right into the EXE files as PRGs.  This may cut down on
  47. EXE size (or then again, it may not).
  48.  
  49.  
  50. C. Usage
  51.  
  52. At the DOS prompt: FRM2PRG {switches} filename{.frm}
  53.  
  54. Expressions in curly braces are optional. 
  55.  
  56. Output is written to the console by default, but can be also sent to a file
  57. (see below). The output file contains several procedures, one of which is
  58. called "xxx_main" ("xxx" defaults to the first three letters of the FRM
  59. filename unless specified--see "switches" below).  As FRM files do not contain
  60. the name of the database file(s) used, there are some places left to fill it
  61. (them) in.  After setting up your DBFs and relationships, etc., you can:
  62.  
  63. SET PROCEDURE TO <output file from FRM2PRG> 
  64. DO xxx_MAIN
  65. CLOSE PROCEDURE
  66.  
  67. ... or you can fill in the SELECTs and USEs within file generated by FRM2PRG.
  68. Of course you can also insert SET RELATION, SET FILTER, complicated formulae, 
  69. and so on.
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.                           -- page 1 --
  80.  
  81.  
  82.                  FRM2PRG Version 2 Documentation
  83.  
  84.  
  85.  
  86. 2. Command-line Switches
  87.  
  88. Switches must be preceded by "/" or "-".  They can be in either upper or lower
  89. case.  Most switches require a parameter to follow them immediately. Switches
  90. supported by version 2.0 are ("*" to right means new in 2.0):
  91.  
  92. O (o) -- output file name (defaults to console);                           * 
  93. T (t) -- "Tab" width -- number of spaces for indents (default: 4);         *
  94.    (use just /t for physical tabs, /t0 for no indents at all)
  95. P (p) -- three letter Prefix for procedure names (default: "any"); 
  96. S (s) -- Screen output                                                     * 
  97. A (a) -- plAin page                                                        * 
  98. U (U) -- sUmmary report only                                               *  
  99. L (l) -- Loop condition (default: ".NOT. EOF()"); 
  100. I (i) -- Initial command after opening databases (default: "GO TOP"); 
  101. E (e) -- Ending command (default: "CLOSE DATA").
  102.  
  103. The latter three switches may often encompass more than one "word", if so, it
  104. gets a little trickier--you enclose the switch, the preceding "-" or "/", and 
  105. the parameter in double quotes, i.e., "/iGO thisrec".  In the case of the
  106. "Initial command" and "Ending command", you can override them entirely  by
  107. using /i or /c with no parameter.
  108.  
  109.  
  110. 3. Examples
  111.  
  112.  
  113.   FRM2PRG /T5 /pCUS "-iSET FILTER TO x=y" "/L&scope" myreport
  114.  
  115. FRM2PRG attempts to read myreport.frm and send output to the screen.
  116. Indentation is in multiples of 5, procedure names start with "CUS_", the
  117. initial command after opening databases is "SET FILTER TO x=y", and the
  118. terminating condition is "&scope" (main loop will say "DO WHILE &scope").
  119.  
  120.   FRM2PRG "-iON ESCA DO prntrupt"  "/EDO endrep" -OMONTHEND.PRG monthend
  121.  
  122. FRM2PRG reads MONTHEND.FRM and creates MONTHEND.PRG. Procedure names start with
  123. the default prefix (first three letters of the FRM filename), indents are in
  124. multiples of 4 (unless you override), initial and ending commands are "ON ESCA
  125. DO prntrupt" and "DO endrep".
  126.  
  127.   FRM2PRG /T testform -S -U -A -Otestproc.prg
  128.  
  129. FRM2PRG reads TESTFORM.FRM, overrides the plAin page and sUmmary settings, and
  130. makes a procedure file to write the report to the screen (TESTPROC.PRG).  Note
  131. that if TESTPROC.PRG exists it will be overwritten without bothering to back it
  132. up [grin].  Also, if the FRM output is 80 or more characters wide the program
  133. will bomb.
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.                           -- page 2 --
  143.  
  144.  
  145.  
  146.                  FRM2PRG Version 2 Documentation
  147.  
  148.  
  149.  
  150. II.  Limitations
  151.  
  152. FRM2PRG should convert most dBASE III Plus FRM files.  Multiple-row headings
  153. should come out fine.  Multiple-row fields or expressions should also work, up
  154. to 4 deep.  FRM2PRG will have a problem, however, if you stack fields and put a
  155. space between "'" and "+":
  156.  
  157. EXPRESSION+";"+EXPRESSION    && OK 
  158. EXPRESSION+';'+EXPRESSION    && OK 
  159. EXPRESSION+ ";" +EXPRESSION  && NOT OK 
  160. EXPRESSION+ ';' +EXPRESSION  && NOT OK
  161. EXPRESSION;EXPRESSION        && NOT OK 
  162.  
  163. The biggest limitation of this program is that it attempts to emulate REPORT
  164. FORM exactly in most ways.  As there are a lot of options such as "plain page",
  165. "summary only", etc. that can produce varied output, FRM2PRG still may need 
  166. some testing to see if it does, indeed, emulate REPORT FORM properly.  However,
  167. thanks to Dale Geffs, J. O'Loughlin, Martin Schiff, Randy Wallin, and others
  168. whose names I have misplaced [grin], this version should be pretty clean.  All
  169. known bugs should be fixed.
  170.  
  171. Differences in output between the PRG and the FRM:
  172.  
  173.  o Subtotals are printed on the same page.  I just can't stand to do it
  174.    otherwise, even though dBASE often doesn't.  You may have to adjust the
  175.    variable "max_lines" downward to avoid page overflow.
  176.  
  177.  o Since dBASE III Plus FRMs do not store the type of each expression, the only
  178.    way I can figure out to right-justify numeric data is to check the fields
  179.    which specify "number of decimals" and "total." This means nontotalling
  180.    numeric fields with 0 decimals (and their headers) may display out of
  181.    alignment unless you add a PICTURE clause yourself.
  182.  
  183.  o Screen output: FRM2PRG generates "write-to-screen" code
  184.    because people asked for it, but FRMs don't do a very good job
  185.    of screen reporting in general.  FRM2PRG attempts to enhance
  186.    the FRM screen output a bit by (1) clearing the screen between
  187.    pages, and (2) pausing at each full screen.  Furthermore, IF
  188.    YOUR REPORT IS WIDE ENOUGH TO WRAP TO THE NEXT LINE THINGS
  189.    WILL GET SCREWED UP ROYALLY.  (This means only use reports
  190.    with a width that will fit entirely on the screen.)
  191.  
  192.  
  193. III. History
  194.  
  195. First Beta release   (0.2): 8/5/87 
  196. Second Beta release  (0.4): 8/7/87 
  197. Third  Beta release  (0.6): 8/15/87 
  198. Fourth Beta release (0.6a): 8/26/87 
  199. First "real" release (1.0): 10/15/87 
  200. Release 2.0:                4/2/89
  201.  
  202.  
  203.  
  204.  
  205.                           -- page 3 --
  206.  
  207.  
  208.  
  209.                  FRM2PRG Version 2 Documentation
  210.  
  211. Version 0.4:
  212.  
  213.  o USEs and SELECTs now moved to *before* control-break "holds" initialized. 
  214.  o A misunderstanding of how C "break" works caused @...SAYs in PROC PRINLOOP
  215.    to    only show fields up to the first totalled field.  Fixed (I hope). 
  216.  o added PICTURE clauses to right-justify numerics (with limitations, see
  217.    above). o changed initializations of headers to use [] instead of "" so
  218.    embedded quotes    would not screw things up.
  219.  o put in an IIF() for indentation of "** Subtotal **" and the like, the
  220.    better   to emulate FRM stuff.
  221.  
  222. Version 0.6:
  223.  
  224.  o fixed subscript problem (?) that was causing garbage in output (sometimes) o
  225.    optimized output code slightly, eliminated major_tots logical field, etc. o
  226.    added options for procedure prefixes, tabs, loop condition, initial command,
  227.    ending command.
  228.  o sent help and error messages to stderr, and beefed 'em up.
  229.  
  230. Version 0.6a:
  231.  
  232.  o changed names of subtots & tots to numerics instead of using the whole field
  233.    expression, which was pretty stupid [grin]--alias names and complex
  234.    expressions came out pretty weird. o fixed totals and subtotals so they
  235.    print on the same line. 
  236.  o fixed so grand totals would not print on a separate page. 
  237.  o fixed margin in minor total routine. 
  238.  o changed the date format so it now prints to the right with the time under
  239.    it.  This is the first real departure from deBASE's FRM output, I could make
  240.    it optional but this is the way I like it.
  241.  
  242. Version 1.0:
  243.  
  244.  o fixed (I hope) problem with blank column headers not being filled--in other
  245.    words, if column a didn't have a second line of heading, column b's
  246.    heading   heading ended up in column a.  
  247.  o Right-justified numeric columns' headings.   
  248.  o Changed default prefix for procedures to first 3 letters of FRM filename.
  249.  o found out what "plain page" really means (grin).
  250.  o changed total-variable names to be a little more readable, other trivial  
  251.    cosmetics in output and program.
  252.  
  253. Version 2.0: 
  254.  
  255.  o fixed situation where major and minor holds only got reset if there were
  256.    total fields, and multiple times if there were multiple total fields.
  257.  o fixed silly reassignment of fields[i] (not good practice [grin]) which
  258.    caused ugly gibberish in PRG file.
  259.  o straightened out other ugly crap like char *anythang="  " instead of char
  260.    anythang[]="   " (gee, he can almost code C these days).
  261.  o added bell to error routine.
  262.  o added -O (output filename) option.
  263.  o fixed summary reports.
  264.  o added plAin page and sUmmary command line options.
  265.  o fixed reiterative major group print (caused bolding? [grin]).
  266.  o eliminated need to use last parameter for FRM filename.
  267.  o added -S "output to screen" option.
  268.  o changed time display to show twelve-hour AM/PM format.
  269.  o enhanced "tab" option to make physical tabs if desired.
  270.  
  271.                           -- page 4 --
  272.  
  273.  
  274.  
  275.                  FRM2PRG Version 2 Documentation
  276.  
  277.  
  278.  
  279. IV.  Registration And Sundry Commercials
  280.  
  281. Commercial time:
  282.  
  283. FRM2PRG was developed using information and techniques from the book: dBASE
  284. POWER: Creating and Using Programming Tools, published by Ashton-Tate (I'm a
  285. co-author, along with Pete Olympia and Randy Wallin).  Peter was nice enough to
  286. lay out the report form structure in terms even my primitive mentality could
  287. grasp.
  288.  
  289. This may be the last version of FRM2PRG.  Then again, it may not [grin]. The
  290. long range plan is to produce a complete report generator to accompany
  291. SCRIMAGE, my screen/menu design tool.  Registered users of FRM2PRG will
  292. probably get a discount on the next thing, whatever it may be, if it actually
  293. happens.  Pretty reassuring, huh?  Actually, suggestions are welcome at this
  294. point and now that SCRIMAGE IS SHIPPING! I'll be devoting more and more time to
  295. the report generator project.
  296.  
  297. I never asked for any money for FRM2PRG in versions before this.  However, I
  298. have received an enormous number of phone calls, which ends up costing me mucho
  299. money.  I also took a lot more time with this version.  What all this is
  300. leading up to is a request for bucks, natch.  I am asking $40 for the program
  301. and access to my BBS.  The BBS is no big deal but I provide support there and I
  302. also try to occasionally post some interesting programs.  And it all costs me
  303. $$$, folks [grin].
  304.  
  305. If you feel like spending more, I have a bunch of miscellaneous BIN routines
  306. for dBASE and whatnot that I call the Synergy Utilities.  To subscribe to the
  307. Synergy Utilities and the BBS (big deal), send $75.  (Send $115 for the utils
  308. and FRM2PRG.)
  309.  
  310. What?  You don't need BIN routines, but you could use a utility to make input
  311. and display screens and menus?  Send $99 for SCRIMAGE, the premiere screen and
  312. menu design tool for dBASE programmers.  (SCRIMAGE is *not* shareware, but a
  313. "demo" version is available that is fully functional except that it cannot save
  314. some file types for later retrieval and modification).  SCRIMAGE comes complete
  315. with a printed manual, demo screen and menu designs, extra utilities for
  316. "popping" screens from various environments, and A THIRTY DAY MONEY-BACK
  317. GUARANTEE!
  318.  
  319. If you are one of those well-intentioned people like me who tend to never get
  320. around to sending the check in, rest easy.  You are hereby granted permission
  321. to use this program forever with no royalty.  You are not, however, allowed to
  322. sell the program or to include it with something you charge for without my
  323. permission.  Please DO NOT call for support if you are not registered!
  324.  
  325. ...enclose $5 extra for shipping and handling if you want a disk mailed to you
  326. with the latest version(s), or if you are ordering SCRIMAGE.  (Most of the
  327. utils are very small, as they are written largely in assembly language and C,
  328. so download time is minimal.)
  329.  
  330. Good luck with FRM2PRG, I hope you enjoy it.
  331.  
  332. R. Russell Freeland
  333. Compuserve 76146,371
  334.                           -- page 5 --
  335.  
  336.                                    ORDER FORM
  337.                              SYNERGY CORP. SOFTWARE
  338.                                       4/89
  339.                              ======================
  340.  
  341. I'm a quick-and-dirty deBASE programmer and I'm not ashamed to admit it! I wish
  342. to register/order the following software from Synergy Corp.:
  343.  
  344. (check all that apply)
  345.  
  346. __ FRM2PRG2: translates dBASE FRM files to semi-lucid PRG form.  
  347.  
  348.    (shareware, $40, no printed manual)
  349.  
  350. __ Synergy Utilities: miscellaneous BIN routines and OBJ files to add    
  351.    functionality to dBASE language environments.
  352.  
  353.    (shareware, $75, no printed manual)
  354.  
  355. __ SCRIMAGE, the premiere screen and menu design tool.
  356.  
  357.    (not shareware, $99, printed manual, demo screen designs, extra utilities 
  358.     included for "popping" full/partial screens from dBASE, Clipper, DOS, and
  359.     other environments Real Soon Now)
  360.  
  361. __ $5 shipping and handling for shipping handling (if you are registering  
  362.      shareware and don't need a disk, don't bother, otherwise mandatory).
  363.  
  364. Total amount enclosed: $_______
  365.  
  366. Where to send all the big bucks:
  367. R. Russell Freeland
  368. Synergy Corp.
  369. 1780 SW 43 Ave.
  370. Ft. Lauderdale, FL 33317
  371.  
  372. I understand that subscription to any or all of this software includes
  373. subscription to the Synergy BBS.  SCRIMAGE also has a 30-day money back
  374. guarantee (you have to say why you can't use it [grin]).
  375.  
  376. Name:  ____________________________________________
  377.  
  378. Phone: (work) ________________(home)_______________
  379.  
  380. Address: __________________________________________
  381.  
  382. City: _____________________________________________
  383.  
  384. State: _____________________  Zip: ________________
  385.  
  386.  
  387. Compuserve number: ________________________________
  388.  
  389. Comments/suggestions: _____________________________________________________
  390.  
  391. ___________________________________________________________________________
  392.  
  393. ___________________________________________________________________________
  394.         
  395.